/* rcsoall1.i - Release Management Customer Schedules                      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                     */
/* All rights reserved worldwide.  This is an unpublished work.            */
/*V8:ConvertMode=NoConvert                                                 */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                    */
/* REVISION: 8.5    LAST MODIFIED: 12/13/95   BY: GWM *J049*               */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan        */
/* REVISION: 8.6    LAST MODIFIED: 04/23/99   BY: *K20L* Anup Pereira      */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* myb               */


         /* SCHEDULE ALLOCATION INCLUDE */



         if open_qty > 0 and all_days <> 0 then do:

/*K20L**    sod_qty_all = max(open_qty - sod_qty_pick,0). */
/*K20L*/    sod_qty_all = open_qty.
            if soc_all_avl and available in_mstr then do:
               if soc_all and not soc_on_ord then
                  sod_qty_all = min(sod_qty_all,
                                max(in_qty_avail - in_qty_all,0)
                                / sod_um_conv).
               else
               if soc_req and not soc_on_ord then
                  sod_qty_all = min(sod_qty_all,
                                max(in_qty_avail - in_qty_req,0)
                                / sod_um_conv).
               else
               if soc_all and soc_on_ord then
                  sod_qty_all = min(sod_qty_all,
                                max(in_qty_avail - in_qty_all + in_qty_ord,0)
                                / sod_um_conv).
               else
               if soc_req and soc_on_ord then
                  sod_qty_all = min(sod_qty_all,
                                max(in_qty_avail - in_qty_req + in_qty_ord,0)
                                / sod_um_conv).
            end.
         end.
